<!DOCTYPE html>
<extend name="Base/base" />
<block name='head'>  
    <meta charset="utf-8">
    <link href="/Public/Index/css/workflow.css" rel="stylesheet" /> 
    <style type="text/css">
        .t4{color:#bbb}
        /*出差小结－转交下一步骤开始*/
        .trip_title h2 {
            font-size:1.2em;
            margin:1.2em;
            color:#5077aa;
        }
        .trip_next h3{
            font-size:1em;
            padding:0.8em;
        }
        .trip_next table{
            width:100%;
            /*border:1px solid red;*/
        }
        .trip_next table tr td{
            border:1px solid #CFDDEA;
            font-size:1.0em;
            padding:0.3em 0;
            /*text-align: center;*/
        }
        .trip_next table .value{
            width:80%;
            text-align: left;
            padding-left:10px;
        }
        .trip_next table .key{
            width:15%;
            text-align: center;
            background: #F0F0F0;
        }
        .top{
            height:5px;
        }
        .bottom{
            height:20px;
        
        .comments{
            border:1px solid red;
        }
        .com1 {
            width:10%;
            font-weight:inherit;
            text-align:left;
        }
    </style>
</block>
<block name="content" > 
    <form>
        <div class="bd">
            <div class="trip_title">
                <h2>工作日志详情</h2>
            </div>
            <div class="work_cells trip_next">
                <p class="top"></p>
                <table>
                    <tr>
                        <td class="key">日志标题</td>
                        <td class="value">{$diary.subject}</td>
                    </tr>
                    <tr>
                        <td class="key">日志日期</td>
                        <td class="value">{$diary.dia_date}</td>
                    </tr>
                    <tr>
                        <td class="key">日志类型</td>
                        <if condition="$diary.dia_type eq 1">
                            <td class="value">工作日志</td>
                        <else />
                            <td class="value">个人日志</td>
                        </if>
                    </tr>
                    <tr>
                        <td class="key">日志内容</td>
                        <td class="value"><textarea style="width:80%;height:20em;border:1px solid #CFDDEA;" readonly>{$diary.content|htmlspecialchars_decode}</textarea></td>
                    </tr>
                    <tr>
                        <td class="key">阅读人员</td>
                        <if condition="$diary.readers eq ''">
                            <td class="value">无人查阅</td>
                        <else />
                            <td class="value">{$diary.readers}</td>
                        </if>   
                    </tr>
                    <tr>
                        <td class="key">评论相关</td>
                        <notempty name="comments">
                            <td class="value">
                                <foreach name="comments" item="comment">
                                    <div style="border:3px solid #CFDDEA;width: 90%;margin-bottom: 10px;">
                                        <table style='margin:5px;width:99%;'>
                                            <tr>
                                                <td style="font-weight:bold;">{$comment.user_name}：{$comment.send_time}&nbsp;
                                                <if condition="$comment.is_del eq 1">
                                                    <a style="color:#437dba;float:right;margin-right:10px;" href="#" class='pointer delDiaryComment' data-id="{$comment.comment_id}">删除</a>
                                                </if>
                                                <if condition="$is_reply eq 1">  
                                                    <a style="color:#437dba;float:right;margin-right:10px;" class="reply" data-id="{$comment.dia_id}" data-key="{$comment.comment_id}">回复</a>
                                                </if>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="padding-left:2px;"><textarea style="width:98%;height:3em;border:1px solid #CFDDEA;" readonly>{$comment.content}</textarea></td>
                                            </tr>
                                            <if condition="$comment.reply neq ''">
                                                <if condition="$is_reply eq 1">
                                                    <foreach name="comment.reply" item="reply">
                                                        <tr>
                                                            <td>
                                                                <p><font style="color:#437dba;font-weight:bold;margin-left:10px;">{$reply.replyer|getChineseName}</font>&nbsp;&nbsp;<font style='font-weight:bold'>回复&nbsp;&nbsp;<font style="color:#437dba;font-weight:bold;">{$reply.to_id|getChineseName}</font>（{$reply.reply_time}）</font><a style="color:#437dba;font-weight:bold;float:right;margin-right:10px;" href="#" class='pointer delReply' data-id="{$reply.reply_id}">删除</a></p>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td><textarea style="width:98%;height:3em;border:1px solid #CFDDEA;" readonly>{$reply.reply_comment}</textarea></td>
                                                        </tr>
                                                    </foreach>
                                                <else />
                                                    <foreach name="comment.reply" item="reply">
                                                        <tr>
                                                            <td>
                                                                <p>回复：{$reply.reply_comment}</p>
                                                                <p>回复时间：{$reply.reply_time}&nbsp;&nbsp;&nbsp;回复人：<font style="color:#437dba;font-weight:bold;margin-left:10px;">{$reply.replyer|getChineseName}</font>&nbsp;&nbsp;
                                                                </p>
                                                            </td>
                                                        </tr>
                                                        
                                                    </foreach>
                                                </if>
                                            </if>
                                        </table>
                                    </div>
                                    <!--<div class="comments">{$comment.content}</div>-->
                                </foreach>
                            </td>
                            
                        <else />
                            <td class="value">无人评论</td>
                        </notempty>
                    </tr>
                </table>
            </div>
        </div>
        <input type="hidden" id="delurlComment" value="{:U('Diary/delDiaryComment')}">
        <input type="hidden" id="delurlReply" value="{:U('Diary/delReply')}">
    </form>
    <p class="bottom"></p>
    <div class="button">
        <a class="am-btn" onclick="history.go(-1)">返 回</a>
    </div>

</block>
<block name="script">
    <script type="text/javascript" src="/Public/Index/js/form.js"></script>
    <script type="text/javascript" src="/Public/Index/js/diary.js"></script>
    <script type="text/javascript">
        $(initDelReply());
        $(initreplyDiary());
        $(initdelDiaryComment());
            
    </script>
</block>
